clear all
set more off
cap log close

**************Globals********************

	
	global home "D:\Dropbox\Research on Florida Wind Patters\"
	global roadsetup "$home/roadsetup/samples/"
	global output "$home/dofiles/makedata"
	global samples "$home/School wind pollution/schools downwind"


cap log using "$output/mk schools downwind loop.log", replace




********************************************************************************

*****keeping just the testing days in different years
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==3
	drop if month==3 & day>6
	replace year=2001 
	
	save "$roadsetup/remake/dayoftest2010_2001.dta", replace	

	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==3
	drop if month==3 & (day<11 | day>18)
	replace year=2002 
	
	save "$roadsetup/remake/dayoftest2010_2002.dta", replace	

	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==3
	drop if month==3 & (day<3 | day>14)
	replace year=2003 
	
	save "$roadsetup/remake/dayoftest2010_2003.dta", replace

	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==3
	drop if month==3 & day>12
	replace year=2004 
	
	save "$roadsetup/remake/dayoftest2010_2004.dta", replace


	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==2 | month==3 
	drop if ((month==2 & day<28) | (month==3 & day>11))
	replace year=2005 
	
	save "$roadsetup/remake/dayoftest2010_2005.dta", replace
	
	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==2 | month==3 
	drop if ((month==2 & day<27) | (month==3 & day>10))
	replace year=2006 
	
	save "$roadsetup/remake/dayoftest2010_2006.dta", replace
	
	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==2 | month==3 
	drop if ((month==2 & day<26) | (month==3 & day>7))
	replace year=2007 
	
	save "$roadsetup/remake/dayoftest2010_2007.dta", replace
	
	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==3	
	drop if month==3 & (day<10 | day>25)
	replace year=2008 
	
	save "$roadsetup/remake/dayoftest2010_2008.dta", replace
	
	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==3 
	drop if month==3 & (day<10 | day>23)
	replace year=2009 
	
	save "$roadsetup/remake/dayoftest2010_2009.dta", replace
	
	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==3 
	drop if month==3 & (day<9 | day>17)
	replace year=2010 
	
	save "$roadsetup/remake/dayoftest2010_2010.dta", replace
	
	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==4
	drop if month==4 & (day<11 | day>22)
	replace year=2011 
	
	save "$roadsetup/remake/dayoftest2010_2011.dta", replace
	
	
	use "$roadsetup/remake/schwind5mi_schroad1mi_mjrrds_5nearestA_2010.dta", clear

	keep if month==4
	drop if month==4 & (day<16 | day>25)
	replace year=2012 
	
	save "$roadsetup/remake/dayoftest2010_2012.dta", replace
	
	
	



	

	
	
	

	
